<template>
  <div>
    <!-- <el-breadcrumb separator="/">
      <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>权限管理</el-breadcrumb-item>
      <el-breadcrumb-item>权限列表</el-breadcrumb-item>
    </el-breadcrumb> -->
    <el-card class="box-card">
      <el-table style="width: 100%" border :data="rights" stripe>
        <el-table-column type="index" label="序号" width="80">
        </el-table-column>
        <el-table-column prop="authName" label="权限名称"> </el-table-column>
        <el-table-column prop="path" label="路径"> </el-table-column>
        <el-table-column prop="level" label="权限等级" >
            <template #default="{ row }">
              <el-button type="primary" plain size="small" disabled v-if="row.level*1==0">一级</el-button>
              <el-button type="success" plain size="small" disabled v-if="row.level*1==1">二级</el-button>
              <el-button type="warning" plain size="small" disabled v-if="row.level*1==2">三级</el-button>
            </template>
        </el-table-column>
      </el-table>
    </el-card>
  </div>
</template>
<script>
  export default {
    data() {
      return {
        rights:[],
      }
    },
    methods: {
    async  LoadRights(){
        let result=await this.$api.getRigths()
        this.rights=result
      }
    },
    created() {
      this.LoadRights();
    },
  }
</script>
<style lang="less" scoped>
.el-breadcrumb {
  margin-bottom: 20px;
}
</style>